/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cl.darksigns.webstat.client.connection;

import cl.darksigns.webstat.client.delegate.WebStatDelegate;
import cl.darksigns.webstat.back.exception.WebStatException;
import org.apache.log4j.Logger;

/**
 *
 * @author _ViKtOr
 */
public class RMIConnection implements Connection {
    
   WebStatDelegate delegate;
   Logger logger = Logger.getLogger(RMIConnection.class);

   /**
    * 
    * @throws cl.darksigns.webstat.back.exception.WebStatException
    */
    public RMIConnection() throws WebStatException {
        delegate = new WebStatDelegate();
    }
    /**
     * 
     * @param xml
     * @return
     */
    public  String sendInformation(String xml){
        logger.debug("asking for WebStat EJB receiver xml");
        return delegate.receiveMessage(xml);
        
    }
    /**
     * 
     * @param xml
     * @return
     * @throws cl.darksigns.webstat.back.exception.WebStatException
     */
    public String sendSpecificInformation(String xml) throws WebStatException{
        logger.debug("asking for WebStat EJB receiver xml");
        return delegate.receiveSpecificMessage(xml);
    }
}
